User:NYC Guru/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:NYC Guru/common.css. |
importScript( 'User:Awesome Aasim/xfdvote.js' ); // Backlink: [[User:Awesome Aasim/xfdvote.js]]
// <nowiki>
$(document).ready(function() {
if ((mw.config.get("wgPageName").includes("Wikipedia:Articles_for_deletion") || mw.config.get("wgPageName").includes("Wikipedia:Files_for_discussion") || mw.config.get("wgPageName").includes("Wikipedia:Miscellany_for_deletion") || mw.config.get("wgPageName").includes("Wikipedia:Categories_for_discussion") || mw.config.get("wgPageName") == "Wikipedia:Redirects_for_discussion" || mw.config.get("wgPageName") == "Wikipedia:Templates_for_discussion" || mw.config.get("wgPageName") == "User:Awesome_Aasim/xfdvote") && sessionStorage.getItem("xfdvotedismissed") != 1 && localStorage.getItem("xfdvotedismissed") != 1) {
$("#siteNotice").append('<div id="xfdvoteinstructions"><table style="border: 1px solid #80bfff; background-color: #cce6ff;padding-left:.5em;padding-right:.5em;"><tbody><tr><td rowspan="2" style="vertical-align:top;padding-bottom:2px;"><img alt="XfD Voting Tool Installed" src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/25px-OOjs_UI_icon_information-progressive.svg.png" decoding="async" width="25" height="25" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/38px-OOjs_UI_icon_information-progressive.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/50px-OOjs_UI_icon_information-progressive.svg.png 2x" data-file-width="512" data-file-height="512"></td><td style="vertical-align: middle;"><small>The <b>XFD voting tool</b> is installed. To use the tool, go to the page which has been nominated for deletion, click on the appropriate vote button and follow the prompts on screen. (For redirects for discussion, you go to the page where the nomination is listed.)</small></td><td id="xfdvoteokbutton1"></td><td id="xfdvoteokbutton2"></td></tr></tbody></table></div>');
$('<button class="mw-ui-button">OK</button>').click(function() {
sessionStorage.setItem("xfdvotedismissed", 1);
$("#xfdvoteinstructions").remove();
}).appendTo("#xfdvoteokbutton1");
$('<button class="mw-ui-button">Don\'t show this again</button>').click(function() {
localStorage.setItem("xfdvotedismissed", 1);
$("#xfdvoteinstructions").remove();
}).appendTo("#xfdvoteokbutton2");
}
});
mw.loader.load("https://en.wikipedia.org/wiki/User:Awesome_Aasim/xfdvote.js/afd.js?action=raw&ctype=text/javascript");
mw.loader.load("https://en.wikipedia.org/wiki/User:Awesome_Aasim/xfdvote.js/mfd.js?action=raw&ctype=text/javascript");
mw.loader.load("https://en.wikipedia.org/wiki/User:Awesome_Aasim/xfdvote.js/rfd.js?action=raw&ctype=text/javascript");
mw.loader.load("https://en.wikipedia.org/wiki/User:Awesome_Aasim/xfdvote.js/cfd.js?action=raw&ctype=text/javascript");
mw.loader.load("https://en.wikipedia.org/wiki/User:Awesome_Aasim/xfdvote.js/ffd.js?action=raw&ctype=text/javascript");
mw.loader.load("https://en.wikipedia.org/wiki/User:Awesome_Aasim/xfdvote.js/tfd.js?action=raw&ctype=text/javascript");
// </nowiki>